package com.qfedu.controller;

import com.github.pagehelper.PageInfo;
import com.qfedu.service.RouteService;
import com.qfedu.util.PageHelperUtil;
import com.qfedu.util.Result;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * projectName: logistics
 *
 * @author: CGY
 * time: 2020-10-7 11:18
 * description:
 */
@RestController
@RequestMapping("/route")
public class RouteController {
    @Autowired
    private RouteService routeService;

    @RequestMapping("/findAllRegions.do")
    public Result findAllRegions(){
        return routeService.findAllRegions();
    }

    @RequestMapping("/findAllExpands.do")
    public PageHelperUtil findAllExpands(){
        PageInfo pageInfo = routeService.findAllExpands();
        return PageHelperUtil.success(pageInfo.getTotal(),pageInfo.getList());
    }

    @RequestMapping("/findAllRoutes.do")
    public Result findAllRoutes(){
        return routeService.findAllRoutes();
    }

}
